package baseFx.common.mq;

import baseFx.common.Action1T;
import baseFx.common.utils.ClassUtils;

public interface MqBeanDispatcher {
    void register(Class<?> clazz);

    void push(MqBean bean);

    default <T extends MqBean> void push(Class<T> clazz, Action1T<T> action) {
        T bean = ClassUtils.newInstance(clazz);
        action.execute(bean);
        push(bean);
    }
}
